package com.tedu.movie.controller;

import com.tedu.movie.pojo.Category;
import com.tedu.movie.pojo.ServerResult;
import com.tedu.movie.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin
@RestController
public class CategoryController {
    @Autowired
    CategoryService categoryService;
    //http://localhost:2020/swagger-ui.html
    @RequestMapping("/category/selectAll")
    public ServerResult selectAll(){
        List<Category> categoryList = categoryService.selectAll();
        return new ServerResult(0,"查询成功",categoryList);
    }
}
